//用于判断用户是否有按钮权限，没有直接删除按钮节点
import pinia from "@/store";
import useUserStore from "@/store/modules/user";
//@ts-ignore
let userStore = useUserStore(pinia);
export const isShowBtn = (app: any) => {
  app.directive("has", {
    mounted(el: any, options: any) {
      if (!userStore.userDetail.buttons.includes(options.value)) {
        el.parentNode.removeChild(el);
      }
    },
  });
};
